//
//  SMViewController.m
//  SMUIKit
//
//  Created by 高泽 on 08/15/2020.
//  Copyright (c) 2020 高泽. All rights reserved.
//

#import "SMViewController.h"
#import <UITextField+Extension.h>
#import <UITableView+Extension.h>
#import <UIButton+Extension.h>
#import <Masonry.h>

@interface SMViewController () <UITableViewDelegate, UITableViewDataSource>

@end

@implementation SMViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	
//    UITextField *textField = [UITextField textFieldWithPlaceholder:@"请输入" textColor:[UIColor redColor] fontSize:17 weight:UIFontWeightBold isShowClearModel:YES addTarget:self action:@selector(textChanged:) forControlEvents:UIControlEventEditingChanged];
//    textField.frame = CGRectMake(50, 50, 250, 30);
//    [self.view addSubview:textField];
//
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom normalImageContentsOfFileNamed:@"ic_we" selectImageContentsOfFileNamed:@"ic_we"];
//    [self.view addSubview:button];
//
//    [button mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.centerX.mas_equalTo(self.view.mas_centerX);
//        make.centerY.mas_equalTo(self.view.mas_centerY);
//    }];
    
    
    UITableView *tableView = [UITableView tableViewWithStyle:UITableViewStylePlain separatorStyle:UITableViewCellSeparatorStyleNone registerClassArray:@[
                              [UITableViewCell class]
                              ]];
    tableView.delegate = self;
    tableView.dataSource = self;
    [self.view addSubview:tableView];
    [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 30;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(UITableViewCell.class) forIndexPath:indexPath];
    cell.textLabel.text = @"123";
    return cell;
}

- (void)textChanged:(UITextField *)textField {
    NSLog(@"%@", textField.text);
}

@end
